Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
The is-regex npm package is a utility for checking if a value is a regular expression. It is primarily used to determine whether a given value is an instance of a RegExp object.
Check if a value is a RegExp
This feature allows you to verify if a value is a regular expression by returning a boolean result. It's useful when you need to ensure that a variable contains a valid RegExp object before performing operations that are specific to regular expressions.
const isRegex = require('is-regex');
console.log(isRegex(/abc/)); // true
console.log(isRegex('abc')); // false
Similar to is-regex, is-regexp is a package that checks if a value is a regular expression. It provides a similar functionality but may have different implementation details or dependencies.
This is a Lodash module to check if a value is classified as a RegExp object. While it offers similar functionality, it comes from the Lodash library which is a broader utility toolkit and might be preferred in projects already using Lodash.
Is this value a JS regex? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isRegex = require('is-regex');
var assert = require('assert');
assert.notOk(isRegex(undefined));
assert.notOk(isRegex(null));
assert.notOk(isRegex(false));
assert.notOk(isRegex(true));
assert.notOk(isRegex(42));
assert.notOk(isRegex('foo'));
assert.notOk(isRegex(function () {}));
assert.notOk(isRegex([]));
assert.notOk(isRegex({}));
assert.ok(isRegex(/a/g));
assert.ok(isRegex(new RegExp('a', 'g')));
Simply clone the repo, npm install
, and run npm test
FAQs
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
The npm package is-regex receives a total of 24,624,329 weekly downloads. As such, is-regex popularity was classified as popular.
We found that is-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.